﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MShop.Core.Domain;
using MShop.Web.Models;
using MShop.Core.DataAccess;
using MShop.Core.Extensions;
using MShop.Core;
using MShop.Core.Service.Membership;


namespace MShop.Web.Controllers
{
    public class AboutController : ControllerBase
    {

        private readonly IArticleDao _ArticleDao;
        private readonly ICommonDao<ArticleCategory> _CommonDao;      
        public AboutController(IArticleDao articleDao,ICommonDao<ArticleCategory> commonDao) 
        {            
            _ArticleDao = articleDao;
            _CommonDao = commonDao;
        }

        public ActionResult Intro()
        {
            AppendMeta("关于我们");
            return View();
        }

        public ActionResult SiteMap()
        {
            AppendMeta("网站地图");            
            return View();
        }
        public ActionResult ContactUs()
        {
            AppendMeta("联系方式");
            return View();
        }
        public ActionResult Ad()
        {
            AppendMeta("广告服务");
            return View();
        }
        public ActionResult Links()
        {
            AppendMeta("友情链接");
            return View();
        }
        public ActionResult Dutyless()
        {
            AppendMeta("免责声明");
            return View();
        }

        public ActionResult Announce()
        {
            AppendMeta("公告列表");
            return View();
        }

        public ActionResult Item(int id)
        {
            ViewData["articles"] = _ArticleDao.Find(x => x.CId == 11);
            var article = _ArticleDao.GetById(id);
            AppendMeta(article.Title);
            return View(article);
        }
    }
}
